using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using PickGold.Charting.Design;

namespace PickGold.Charting
{
	[DefaultProperty("SkinStyle")]
	[SRDescription("DescriptionAttributeBorderSkin_BorderSkin")]
	[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	public class BorderSkin : ChartElement
	{
		private Color _backColor;
		private GradientStyle _backGradientStyle;
		private ChartHatchStyle _backHatchStyle;
		private string _backImage;
		private ChartImageAlignmentStyle _backImageAlignment;
		private Color _backImageTransparentColor;
		private ChartImageWrapMode _backImageWrapMode;
		private Color _backSecondaryColor;
		private Color _borderColor;
		private ChartDashStyle _borderDashStyle;
		private int _borderWidth;
		private Color _pageColor;
		private BorderSkinStyle _skinStyle;

		public BorderSkin()
		{
			this._pageColor = Color.White;
			this._backSecondaryColor = Color.Empty;
			this._backColor = Color.Gray;
			this._backImage = "";
			this._backImageTransparentColor = Color.Empty;
			this._borderColor = Color.Black;
			this._borderWidth = 1;
		}

		internal BorderSkin(IChartElement parent)
			: base(parent)
		{
			this._pageColor = Color.White;
			this._backSecondaryColor = Color.Empty;
			this._backColor = Color.Gray;
			this._backImage = "";
			this._backImageTransparentColor = Color.Empty;
			this._borderColor = Color.Black;
			this._borderWidth = 1;
		}

		[PersistenceMode(PersistenceMode.Attribute), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), DefaultValue(typeof(Color), "Gray"), SRDescription("DescriptionAttributeFrameBackColor"), TypeConverter(typeof(ColorConverter)), Editor(typeof(ChartColorEditor), typeof(UITypeEditor))]
		public Color BackColor
		{
			get
			{
				return this._backColor;
			}
			set
			{
				this._backColor = value;
				this.Invalidate();
			}
		}

		[Editor(typeof(GradientEditor), typeof(UITypeEditor)), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), DefaultValue(0), SRDescription("DescriptionAttributeBackGradientStyle"), PersistenceMode(PersistenceMode.Attribute)]
		public GradientStyle BackGradientStyle
		{
			get
			{
				return this._backGradientStyle;
			}
			set
			{
				this._backGradientStyle = value;
				this.Invalidate();
			}
		}

		[DefaultValue(0), PersistenceMode(PersistenceMode.Attribute), Editor(typeof(HatchStyleEditor), typeof(UITypeEditor)), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), SRDescription("DescriptionAttributeFrameBackHatchStyle")]
		public ChartHatchStyle BackHatchStyle
		{
			get
			{
				return this._backHatchStyle;
			}
			set
			{
				this._backHatchStyle = value;
				this.Invalidate();
			}
		}

		[DefaultValue(""), Editor(typeof(ImageValueEditor), typeof(UITypeEditor)), Bindable(true), NotifyParentProperty(true), SRCategory("CategoryAttributeAppearance"), SRDescription("DescriptionAttributeBackImage"), PersistenceMode(PersistenceMode.Attribute)]
		public string BackImage
		{
			get
			{
				return this._backImage;
			}
			set
			{
				this._backImage = value;
				this.Invalidate();
			}
		}

		[Bindable(true), SRCategory("CategoryAttributeAppearance"), PersistenceMode(PersistenceMode.Attribute), NotifyParentProperty(true), DefaultValue(0), SRDescription("DescriptionAttributeBackImageAlign")]
		public ChartImageAlignmentStyle BackImageAlignment
		{
			get
			{
				return this._backImageAlignment;
			}
			set
			{
				this._backImageAlignment = value;
				this.Invalidate();
			}
		}

		[DefaultValue(typeof(Color), ""), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), SRDescription("DescriptionAttributeImageTransparentColor"), TypeConverter(typeof(ColorConverter)), Editor(typeof(ChartColorEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.Attribute)]
		public Color BackImageTransparentColor
		{
			get
			{
				return this._backImageTransparentColor;
			}
			set
			{
				this._backImageTransparentColor = value;
				this.Invalidate();
			}
		}

		[SRCategory("CategoryAttributeAppearance"), PersistenceMode(PersistenceMode.Attribute), Bindable(true), NotifyParentProperty(true), DefaultValue(0), SRDescription("DescriptionAttributeImageWrapMode")]
		public ChartImageWrapMode BackImageWrapMode
		{
			get
			{
				return this._backImageWrapMode;
			}
			set
			{
				this._backImageWrapMode = value;
				this.Invalidate();
			}
		}

		[TypeConverter(typeof(ColorConverter)), SRDescription("DescriptionAttributeBorderSkin_FrameBackSecondaryColor"), Editor(typeof(ChartColorEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.Attribute), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), DefaultValue(typeof(Color), "")]
		public Color BackSecondaryColor
		{
			get
			{
				return this._backSecondaryColor;
			}
			set
			{
				this._backSecondaryColor = value;
				this.Invalidate();
			}
		}

		[Editor(typeof(ChartColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(ColorConverter)), PersistenceMode(PersistenceMode.Attribute), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true), DefaultValue(typeof(Color), "Black"), SRDescription("DescriptionAttributeBorderColor")]
		public Color BorderColor
		{
			get
			{
				return this._borderColor;
			}
			set
			{
				this._borderColor = value;
				this.Invalidate();
			}
		}

		[SRCategory("CategoryAttributeAppearance"), NotifyParentProperty(true), DefaultValue(0), PersistenceMode(PersistenceMode.Attribute), Bindable(true), SRDescription("DescriptionAttributeBorderSkin_FrameBorderDashStyle")]
		public ChartDashStyle BorderDashStyle
		{
			get
			{
				return this._borderDashStyle;
			}
			set
			{
				this._borderDashStyle = value;
				this.Invalidate();
			}
		}

		[PersistenceMode(PersistenceMode.Attribute), DefaultValue(1), SRDescription("DescriptionAttributeBorderSkin_FrameBorderWidth"), SRCategory("CategoryAttributeAppearance"), Bindable(true), NotifyParentProperty(true)]
		public int BorderWidth
		{
			get
			{
				return this._borderWidth;
			}
			set
			{
				if (value < 0)
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsNotPositive);
				}
				this._borderWidth = value;
				this.Invalidate();
			}
		}

		[Bindable(true), PersistenceMode(PersistenceMode.Attribute), SRCategory("CategoryAttributeAppearance"), NotifyParentProperty(true), DefaultValue(typeof(Color), "White"), SRDescription("DescriptionAttributeBorderSkin_PageColor"), TypeConverter(typeof(ColorConverter)), Editor(typeof(ChartColorEditor), typeof(UITypeEditor))]
		public Color PageColor
		{
			get
			{
				return this._pageColor;
			}
			set
			{
				this._pageColor = value;
				this.Invalidate();
			}
		}

		[Bindable(true), PersistenceMode(PersistenceMode.Attribute), ParenthesizePropertyName(true), SRDescription("DescriptionAttributeBorderSkin_SkinStyle"), SRCategory("CategoryAttributeAppearance"), NotifyParentProperty(true), DefaultValue(0)]
		public BorderSkinStyle SkinStyle
		{
			get
			{
				return this._skinStyle;
			}
			set
			{
				this._skinStyle = value;
				this.Invalidate();
			}
		}
	}
}

